
/*
 * .
 * All Rights Reserved.
 */
package com.model.demo.designmodel.prototype.simple;

import java.util.ArrayList;

/**
 * PrototypeTest
 *
 * @author Liao Dongshan, 2019年05月14日
 *
 */
public class PrototypeTest  {
    public static void main(String[] args) {
        //浅克隆
        ConcretePrototype concretePrototype=new ConcretePrototype();
        concretePrototype.setAge(18);
        concretePrototype.setName("lds");
        concretePrototype.setHobbies(new ArrayList<>());

        Client client=new Client();
        ConcretePrototype copy = (ConcretePrototype) client.startClone(concretePrototype);
        System.out.println(copy.getHobbies()==concretePrototype.getHobbies());

    }


}
